<div class="modal fade in ip-box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" id="newlyAdded">
    <div class="modal-dialog modal-lg" role="document" style="margin: 254px auto;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="myModalLabel">应用管理 — 新增</h4>
            </div>
            <div class="modal-body">

                <form name="newlyAddedForm">
                    
					<div class="col-xs-12 col-sm-6">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 control-label text-right">名称：</label>
                            <div class="col-xs-12 col-sm-9">
                                <input type="text"
                                	   name="appName"
                                	   autocomplete="off" 
                                	   class="form-control" 
                                	   required
                                	   ng-model="newlyAdded_appName"
                                	   >
                                <label class="red required">*</label>
                                <div class="error ng-hide" ng-show="newlyAddedForm.appName.$dirty &amp;&amp; newlyAddedForm.appName.$invalid">
									<small class="error" ng-show="newlyAddedForm.appName.$error.required">请输入名称</small>
								</div>
                            </div>       
                        </div>
                         <div class="form-group ">
                            <label class="col-xs-12 col-sm-3 control-label text-right">唯一标识：</label>
                            <div class="col-xs-12 col-sm-9">
                                <input type="text" 
                                	   name="appKey"
                                	   class="form-control"
                                	   readonly  
                                	   ng-model="newlyAdded_appKey"
                                	   >
                            </div>       
                        </div>

                        <div class="form-group " >
                            <label class="col-xs-12 col-sm-3 control-label text-right">密钥：</label>
                            <div class="col-xs-12 col-sm-9">
                                <input type="text" 
                                	   name="appSecret"
                                	   class="form-control" 
                                	   readonly
                                	   ng-model="newlyAdded_appSecret"
                                	   >
                            </div>       
                        </div>

                        <div class="form-group" >
                            <label class="col-xs-12 col-sm-3 control-label text-right">图片：</label>
                            <div class="col-xs-12 col-sm-9">
                                <div class="input-group col-md-12 pull-right">
                                    <input type="file" 
                                           class="btn btn-sm" 
                                           nv-file-select 
                                           uploader="uploader"
                                           >
                                    <ul>
                                        <li ng-repeat="item in uploader.queue">
                                            文件名：<span ng-bind="item.file.name"></span>
                                            <button type="button"
                                                    class="btn btn-sm btn-primary" 
                                                    ng-click="item.upload()"
                                                    >上传
                                            </button>
                                        </li>
                                    </ul>
                                </div>
                            </div>  
                            <div class="overflow-hide app-img col-xs-12 col-sm-6">
                            	<img ng-src="{{ newlyAdded_appImage }}">
                            </div>     
                        </div>

                        <div class="form-group ">
                            <label class="col-xs-12 col-sm-3 control-label text-right">应用类型：</label>
                            <div class="col-xs-12 col-sm-9">
                                <select name="appType" 
                                		required 
                                	    ng-model="newlyAdded_appType"
                                	    >
                                	<option value="">请选择</option>
                                	<option value="0">普通应用</option>
                                	<option value="1">内部站点</option>
								</select>
								<div class="error ng-hide" ng-show="newlyAddedForm.appType.$dirty &amp;&amp; newlyAddedForm.appType.$invalid">
									<small class="error" ng-show="newlyAddedForm.appType.$error.required">请选择应用类型</small>
								</div>
                            </div>       
                        </div>
                       
                        <div class="form-group ">
                            <label class="col-xs-12 col-sm-3 control-label text-right">应用状态：</label>
                            <div class="col-xs-12 col-sm-9">
                                <select name="status"  
                                		required 
                                		ng-model="newlyAdded_status"
                                		>
                                	<option value="">请选择</option>
                                	<option value="0">待审核</option>
                                	<option value="1">正常</option>
                                	<option value="2">冻结</option>
                                	<option value="3">逻辑删除</option>
                                	<option value="4">不合格</option>
								</select>
								<div class="error ng-hide" ng-show="newlyAddedForm.status.$dirty &amp;&amp; newlyAddedForm.status.$invalid">
									<small class="error" ng-show="newlyAddedForm.status.$error.required">请选择应用状态</small>
								</div>
                            </div>       
                        </div>
                    </div> 

                    <div class="col-xs-12 col-sm-6">
                        <div class="form-group ">
                            <label class="col-xs-12 col-sm-3 control-label text-right">URL：</label>
                            <div class="col-xs-12 col-sm-9">
                                <input type="text" 
                                	   name="appUri"
                                	   autocomplete="off" 
                                	   class="form-control" 
                                	   required 
                                	   ng-model="newlyAdded_appUri"
                                	   >
                                <label class="red required">*</label>
                                <div class="error ng-hide" ng-show="newlyAddedForm.appUri.$dirty &amp;&amp; newlyAddedForm.appUri.$invalid">
									<small class="error" ng-show="newlyAddedForm.appUri.$error.required">请输入URL</small>
								</div>
                            </div>       
                        </div>

                        <div class="form-group ">
                            <label class="col-xs-12 col-sm-3 control-label text-right">IP地址：</label>
                            <div class="col-xs-12 col-sm-9">
                                <input type="text" 
                                	   name="appIp"
                                	   autocomplete="off" 
                                	   class="form-control" 
                                	   required 
                                	   ng-model="newlyAdded_appIp"
                                	   >
                                <label class="red required">*</label>
                                <div class="error ng-hide" ng-show="newlyAddedForm.appIp.$dirty &amp;&amp; newlyAddedForm.appIp.$invalid">
									<small class="error" ng-show="newlyAddedForm.appIp.$error.required">请输入IP地址</small>
								</div>
                            </div>       
                        </div>
						
						<div class="form-group">
                            <label class="col-xs-12 col-sm-3 control-label text-right" >授权类型：</label>
                            <div class="col-xs-12 col-sm-9">
                            	<div class="checkbox">
	                                <input type="checkbox"
	                                	   name="authType" 
	                                	   style="margin-left:0;" 
	                                	   ng-checked="true" 
                                           disabled 
	                                	   >
	                                <span style="margin-left:16px;">授权码Code</span>
                                </div>
                            </div>       
                        </div>

                    </div>

                    <div class="col-xs-12 col-sm-12">
                    	<div class="form-group">
                            <label class="col-xs-12 col-sm-2 control-label text-right">许可类型：</label>
                            <div class="col-xs-12 col-sm-10" style="padding-top:8px;">
                            	
								<div class="margin-top-zero checkbox col-xs-12 col-sm-3" ng-repeat="val in authType">
	                                <input type="checkbox"
	                                	   name="sysValue" 
	                                	   ng-model="sysValState"
	                                	   ng-click="getSysVal(sysValState, val.sysVal, $index)"
	                                	   >
	                                <span>{{ val.displayName }}</span>
                                </div>

                            </div>
                        </div>
                    </div>

                    <div class="col-xs-12 col-sm-12">
                    
                        <div class="form-group">
                            
                            <label class="col-xs-12 col-sm-2 control-label text-right">授权范围：</label>

                            <div class="col-xs-12 col-sm-10">

                                <fieldset class="field">
                                    <legend>
                                        <input type="checkbox"
                                               ng-model="master0" 
                                               ng-checked="isCheck0" 
                                               ng-mousedown="operationNewlyAdded()" 
                                               ng-click="selectAll(master0, 0)"
                                               >
                                        <span>{{ serviceTypeName0 }}</span>
                                    </legend>
                                    <div style="padding-left:30px">
                                        <div class="col-xs-6 col-sm-3" ng-repeat="val in scopes0">
                                            <input type="checkbox"
                                                   ng-checked="master0" 
                                                   ng-mousedown="operationNewlyAdded()" 
                                                   ng-click="select(val, bool, 0)"
                                                   ng-model="bool" 
                                                   >
                                            <span>{{ val.scopeName }}</span>
                                        </div>
                                    </div>
                                </fieldset>

                                <fieldset class="field">
                                    <legend>
                                        <input type="checkbox"
                                               ng-model="master1"
                                               ng-checked="isCheck1" 
                                               ng-mousedown="operationNewlyAdded()" 
                                               ng-click="selectAll(master1, 1)"
                                               >
                                        <span>{{ serviceTypeName1 }}</span>
                                    </legend>
                                    <div style="padding-left:30px">
                                        <div class="col-xs-6 col-sm-3" ng-repeat="val in scopes1">
                                            <input type="checkbox"
                                                   ng-checked="master1" 
                                                   ng-mousedown="operationNewlyAdded()" 
                                                   ng-click="select(val, bool, 1)"
                                                   ng-model="bool" 
                                                   >
                                            <span>{{ val.scopeName }}</span>
                                        </div>
                                    </div>
                                </fieldset>
                            </div>

                        </div>

                    </div>

                    <div class="col-xs-12 col-sm-12">
                    	<div class="form-group">
                            <label class="col-xs-12 col-sm-2 control-label text-right">简介：</label>
                            <div class="col-xs-12 col-sm-10">
                                <textarea rows="5" 
                                		  type="text" 
                                		  name="description" 
                                		  class="form-control" 
                                          ng-model="newlyAdded_appSummary"
                                		  >                                    
                                </textarea>
                                
                            </div>
                    	</div>
                	</div>

                </form>

                <div class="col-sm-12">
                    <div class="modal-footer">
                        <button type="button" 
                                class="btn btn-primary" 
                                data-dismiss="modal"
                                ng-disabled="newlyAddedForm.$invalid||hasSyaVal==0||hasSelect==0"
                                ng-mousedown="operationNewlyAdded()" 
                                ng-click="submitNewlyAdded()"
                                >新增
                        </button>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>